﻿using System.Windows;
using System.Windows.Input;
using Microsoft.Practices.Composite.Wpf.Commands;
using WpfTwitterClient.Infrastructure;

namespace WpfTwitterClient
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public DelegateCommand<string> myCommand;

        public MainWindow(InfrastructureCommandProxy proxy)
        {
            myCommand = new DelegateCommand<string>(ApplicationCloseEventHandler, CanClose);
            proxy.ApplicationCommands.RegisterCommand(myCommand);
            InitializeComponent();
        }

        public bool CanClose(string str)
        {
            return true;
        }

        private void ApplicationCloseEventHandler(string input)
        {
            this.Close();
        }

        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }

    }
}
